import './App.css';
import { useRoutes, useLocation } from 'react-router-dom'
import route from './routes'
import { syncRouter } from '@src/utils/index'

function App() {
  const routeData = syncRouter(route)
  const routeMap = routeData.routeMap
  const mRouteTable = routeData.mRouteTable
  const element = useRoutes(mRouteTable)
  const location = useLocation()
  const pathname = routeMap[location.pathname]?.name
  document.title = `简历-${pathname}`
  return (
    <>
      {element}
    </>
  )
}

export default App;
